<?php

namespace app\controller\admin;

use app\common\model\Admin;
use app\common\service\AdminLogService as Service;
use think\annotation\route\Group;
use think\annotation\route\Post;

#[Group('admin/adminLog')]
class AdminLogController extends AdminAuthorizedController
{
    //权限前缀
    protected string $power_prefix = "AdminLog";

    /**
     * 初始化业务
     * @return Service
     */
    protected function initService()
    {
        return new Service($this->app);
    }

    /**
     * 后台分页
     * @param Admin $admin
     * @return \think\Paginator
     */
    #[Post('page')]
    public function page(Admin $admin)
    {
        $this->checkPower($admin, $this->power_prefix . '_' . 'index');
        return $this->initService()->adminPage();
    }

    /**
     * 详情
     * @param Admin $admin
     * @return \think\Paginator
     */
    #[Post('detail')]
    public function detail(Admin $admin)
    {
        $this->checkPower($admin, $this->power_prefix . '_' . 'index');
        return $this->initService()->detail();
    }
}
